home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / arexx / cg / batchloadpages.rexx < prev    next >
OS/2 REXX Batch file  |  1995-12-22  |  1KB  |  52 lines

  1. /* BatchLoadPages.rexx V1.0 -- Load Pages in a directory.        */
  2. /* By Bob Caron (Grue) © 1995 NewTek, Inc.                       */
  3.  
  4. call remlib('rexxsupport.library')
  5. call remlib(CG_AREXX)
  6.  
  7. call addlib(CG_AREXX,0)
  8. call addlib("rexxsupport.library", 0,-30,0)
  9.  
  10. file=REQ_DIR("Load From Where?","Toaster:CG")
  11.  
  12. if file="" then call quit()
  13.  
  14. if lastpos('/',file,length(file)-1)~=0 then do
  15.    filenam=right(file,(length(file)-lastpos('/',file,length(file)-1)))
  16.    path=left(file,(lastpos('/',file,length(file))-1))
  17.    end
  18. else do
  19.    filenam=right(file,(length(file)-lastpos(':',file,length(file)-1)))
  20.    path=left(file,(lastpos(':',file,length(file))))
  21.    end
  22.  
  23. if pragma('d',path||filenam)="" then file=path
  24. else file=path||filenam
  25.  
  26.   dir = showdir(path ,'f','*')
  27.   test=translate(dir,'?',' ','?')
  28.   test2=translate(test,' ','*',' ')
  29.   dir = test2
  30.  
  31. loopto=words(dir)
  32. call req_tell(loopto)
  33. loop=1
  34. do while (loop<loopto+1)
  35.    frame=translate(word(dir,loop),' ','?')
  36.    if upper(right(frame,2))~=".I" then
  37.       call loadpage(path||"/"||frame,0)
  38.    loop=loop+1
  39. end
  40.  
  41. call REQ_TELL("Done.")
  42.  
  43. call remlib('rexxsupport.library')
  44. call remlib(CG_AREXX)
  45. exit
  46.  
  47. quit: PROCEDURE
  48.    call remlib(CG_AREXX)
  49.    call remlib('rexxsupport.library')
  50.    exit
  51.  
  52.